// 消息提示窗
export function showToast(title = '...', icon = 'none', duration = 2000) {
	uni.showToast({ title, icon, duration, mask: true})
}


// loading 窗口
export function showLoading(title = '...', icon = 'loading') {
	uni.showLoading({
		title,
		icon,
		mask: true,
		// duration
	})
}

// 关闭loading窗口
export function hideLoading(title = '...', icon= 'loading', duration = 100) {
	uni.showToast({
		title,
		icon,
		mask: true,
		duration
	})
}

export function showModal(title, content,showCancel =true) {
	return new Promise(resolve => {
		uni.showModal({
			title,
			content,
			showCancel,
			complete: res => {
				resolve(res.confirm ? true : false)
			}
		})
	})
}